//
//  HomeItemModel.m
//  Lightthings
//
//  Created by Hero on 2024/11/16.
//

#import "HomeItemModel.h"

@implementation HomeItemModel
- (instancetype)init {
    if (self = [super init]) {
        [super prepareLayout:kSize((kScreenWidth - 40) / 2, 130)];
    }
    return self;
}

- (NSString *)idf {
    if (self.idfBlock) return self.idfBlock();
    return @"HomeItemCell";
}

+ (HomeItemModel *)cModelWithImage:(NSString *)img Title:(NSString *)title Value:(NSAttributedString *)value ViewColor:(NSString *)color{
    HomeItemModel * stepM = [[HomeItemModel alloc] init];
    stepM.img = img;
    stepM.title = title;
    stepM.value = value;
    stepM.colorhex = color;
    return stepM;
}

+ (HomeItemModel *)cModelWithBgImage:(NSString *)img Title:(NSString *)title Value:(NSAttributedString *)value SmallImg:(NSString *)img2 {
    HomeItemModel * stepM = [[HomeItemModel alloc] init];
    stepM.img = img;
    stepM.title = title;
    stepM.value = value;
    stepM.img2 = img2;
    stepM.idfBlock = ^NSString * _Nonnull{
        return @"PillowHomeCell";
    };
    stepM.layout.itemSize = CGSizeMake(kScreenWidth / 2- 25, 130);

    return stepM;
}

@end
